package com.igda.tihbms.data;

import android.graphics.Bitmap;

public class Rock extends GameObject {

	private float dx;
	private float dy;
	private float angle;

	public Rock(float posX, float posY, Bitmap  image) {
		super(posX, posY, new Sprite(new byte[] { 0 }, image
				, 1));

		this.dx = (float) ((Math.random() - .5) * 3);
		while (this.dy == 0) {
			this.dy = (float) (Math.random() * 3);
		}
		this.angle = (float) ((Math.random() - .5) * 8);
	}

	@Override
	public void tick() {
		this.moveXY(this.dx, this.dy);

		if (this.posY > 500) {
			this.dead = true;
		}

		 this.sprite.rotate(this.angle);
	}
}
